package com.example.b_308.medical.view.splash;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.annotation.Nullable;

import com.example.b_308.medical.Login_RegisterActivity;
import com.example.b_308.medical.R;
import com.example.b_308.medical.controller.SplashController;
import com.example.b_308.medical.view.base.BaseActivity;

import java.util.List;

/**
 * Created by B-308 on 2017/11/15.
 */
public class SplashActivity extends BaseActivity implements IsSplashView {
    SplashController splashController;
    CountDownTimer countDownTimer = new CountDownTimer(1000, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {

        }

        @Override
        public void onFinish() {
            startActivity(new Intent(SplashActivity.this, Login_RegisterActivity.class));
        }
    };

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        splashController = new SplashController(this);
        splashController.check();
    }

    @Override
    public void haveNewVersion() {
    }

    @Override
    public void isFirstUsed() {
    }

    @Override
    public void haveUnAblePermission(List<String> permissions) {

    }

    @Override
    public void checkSuccess() {
        countDownTimer.start();
    }



    @Override
    public void fail(String message) {

    }
}
